Understanding interfaces [closed]

Posted by user985482 on Programmers See other posts from Programmers or by user985482
Published on 2012-09-03T10:13:31Z Indexed on 2012/09/03 15:51 UTC
Read the original article Hit count: 206

Filed under:
|
|

Possible Duplicate:
When to use abstract classes instead of interfaces and extension methods in C#?
Why are interfaces useful?
What is the point of an interface?
What other reasons are there to write interfaces rather than abstract classes?
What is the point of having every service class have an interface?
Is it bad habit not using interfaces?

I am reading Microsoft Visual C# 2010 Step by Step which I feel it is a very good book on introducing you to the C# language. I have just finished reading a chapter on interfaces and although I understood the syntax of creating and using interfaces I have trouble of understanding the point on why should I use them?

Correct me If I am wrong but in an interface you can only declare methods names and parameters.The body of the method should be declared in the class that inherits the interface.

So in this case why should I declare an interface if I am going to declare the entire method in the class that inherits that interface?

What is the point?

Does this have something to do with the fact that a class can inherit multiple interfaces?

© Programmers or respective owner

Related posts about c#

Related posts about learning